package br.unesp.ibb.lbbc.testes;

import java.io.File;
import java.io.IOException;

import javax.xml.stream.XMLStreamException;

import org.sbml.jsbml.Compartment;
import org.sbml.jsbml.ListOf;
import org.sbml.jsbml.Model;
import org.sbml.jsbml.Reaction;
import org.sbml.jsbml.SBMLDocument;
import org.sbml.jsbml.SBMLReader;
import org.sbml.jsbml.SpeciesReference;

public class TestaSBML {

	public TestaSBML (){
		
		File file = new File("D:\\0-DOUTORADO\\TRABALHO\\PLUGIN-FBA\\testes\\small.xml");
		SBMLReader reader = new SBMLReader();
		SBMLDocument doc = null;
		
		try {
			doc = reader.readSBML(file);
		} catch (XMLStreamException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		Model model = doc.getModel();
		ListOf<Compartment> listOfComp = model.getListOfCompartments();
		
		ListOf<Reaction> listReactions = model.getListOfReactions();
		
		// criar a matriz estequimetrica
/*		for (Reaction reaction: listReactions){
			ListOf<SpeciesReference> reagentes = reaction.getListOfReactants();
			for (SpeciesReference ref: reagentes){
				System.out.println(ref.getStoichiometry());
			}
		}*/
		
		for (Reaction reaction: listReactions){
			ListOf<SpeciesReference> produtos = reaction.getListOfProducts();
			for (SpeciesReference ref: produtos){
				System.out.println(ref.getStoichiometry());
			}
		}
				
	}
	
	
	public static void main(String[] args) {
		TestaSBML t = new TestaSBML();

	}

}
